package com.k.designpattern.creational.factory.staticfactory;

public class Test {
    public static void main(String[] args) {
        // new way Teacher
        User u1 = new User();
        u1.setType(1);

        // new way Student
        User u2 = new User();
        u2.setType(2);

        // factory way
        User student = UserFactory.newTeacherInstance();

        // factory way
        User teacher = UserFactory.newStudentInstance();
    }
}
